package com.universe.springmvc.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.universe.springmvc.pojo.Teacher;
import com.universe.springmvc.service.TeacherService;

@Controller
public class TeacherController {

	@Autowired
	public TeacherService teacherService;
	
	@RequestMapping("get/teacher")
	public @ResponseBody Teacher getTeacher(Integer id){
		
		Teacher teacher=teacherService.getTeacherById(id);
		
		return teacher;
	}
	
	
	@RequestMapping("get/teacherlist")
	public @ResponseBody List<Teacher> getAllTeacher(){
		
		return teacherService.getAllTeacher();
	}
}
